package com.xd.demo.dto;

import com.xd.demo.constant.RelationType;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * 联系方式
 *
 * @author daishun
 * @since 2019/8/27
 */
@Data
public class ContactInfo implements Serializable {
    /**
     * 关系类型
     */
    @NotNull
    private RelationType relationType;
    /**
     * 联系人手机号
     */
    @NotBlank
    @Size(max = 20)
    @Pattern(regexp = "^([0-9]{11})?$")
    private String mobile;
    /**
     * 联系人姓名
     */
    @NotBlank
    @Size(max = 100)
    private String name;
    /**
     * 联系人地址
     */
    @Size(max = 100)
    private String address;
}
